import React from 'react';
import { Router, Route, Link,IndexRoute,hashHistory } from 'react-router';
import { createStore } from 'redux';
import { Provider } from 'react-redux';   
import ConfigureStore from './base/stores/ConfigureStore';
import RouterFilter from "./RouterFilter";

const store = ConfigureStore();

const routes = {
  component: 'div',
  childRoutes: [{
    path: '/',
    onEnter:function(nextState, replace, callback){  
         RouterFilter.process(nextState, replace, callback); 
    },
    onChange:function(prevState, nextState, replace, callback){ 
         RouterFilter.process(nextState, replace, callback,prevState); 
    },
    component: require('./Launch'),
    childRoutes: [
      require('./business/test/routes.js') 
    ]
  }]
};

var RouterConfig=(
	<Provider store={store} key="provider">
		<Router history={hashHistory} routes={routes} />
	</Provider>);

module.exports=RouterConfig; 